package com.laijiale.dto;

import com.laijiale.constant.RE;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.Pattern;
import java.io.Serializable;

import static com.laijiale.constant.RE.*;

/**
 * @author laijiale
 * @date 2025年01月09日 10:31
 */

@Schema(name="登录DTO")
@Data
public class LoginDTO implements Serializable, RE {

    @Schema(description = "登录账号")
    @NotEmpty(message="登录账号不能为空")
    @Pattern(regexp = USERNAME_RE, message = USERNAME_RE_MSG)
    private String username;

    @Schema(description = "登录密码")
    @NotEmpty(message ="登录密码不能为空")
    @Pattern(regexp = PASSWORD_RE, message = PASSWORD_RE_MSG)
    private String password;
}
